package me.keiwu.user.service;

import me.keiwu.pub.data.ResponseV2;
import me.keiwu.pub.data.enums.NoticeType;
import me.keiwu.user.domain.Notice;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * Created by kei on 05/02/2018.
 */
public interface NoticeService {


    Notice notice(NoticeType noticeType, Long fromUser, Long toUser, String addition, boolean redPoint);

    /**
     * 唯一通知，每次只会更新，不会新增
     * @param noticeType
     * @param fromUser
     * @param toUser
     * @param addition
     * @param redPoint
     * @return
     */
    Notice uniqueNotice(NoticeType noticeType, Long fromUser, Long toUser, String addition, boolean redPoint);


    /**
     * 唯一通知，通过noticetype 和 uniqueKey索引
     * @param noticeType
     * @param uniqueKey
     * @param fromUser
     * @param toUser
     * @param addition
     * @param redPoint
     * @return
     */
    Notice uniqueNotice(NoticeType noticeType, String uniqueKey, Long fromUser, Long toUser, String addition, boolean redPoint);

    ResponseV2 read(Long noticeId);

    ResponseV2 readMulti(List<Long> noticeId);

    Page<Notice> list(Long userId, NoticeType noticeType, int page, int size);

    boolean checkNotRead(Integer noticeType, Long userId);

    Page<Notice> unreadChallengeNoticeList(int page, int size, int startTime, int endTime);

}
